#include "blankBG.h"

#include <QDebug>

BlankBackground::BlankBackground(Page* parent): BGSource(parent)
{
    m_pixmap = 0;
}

void BlankBackground::renderBackgroundPixmap(QSizeF size)
{
    if (m_pixmap != 0) {
        delete m_pixmap;
        m_pixmap = 0;
    }
    m_pixmap = new QPixmap(size.toSize());
    m_pixmap->fill(Qt::white);

    emit bgRendered(m_pixmap);
}

BlankBackground::~BlankBackground()
{
    delete m_pixmap;
}

bool BlankBackground::rendering()
{
    // No thread used, so there is never a rendering state.
    return false;
}

BGSource* BlankBackground::deepCopy()
{
    BlankBackground *result = new BlankBackground((Page*)parent());
    return result;
}
